<template>
  <div>
    <button @click="add(1)">+</button>
    <span style="padding: 0 20px">{{ num }}</span>
    <button @click="add(-1)">-</button>
  </div>
</template>
<script>
export default {
  props: {
    num: {
      required: true,
      type: Number
    }
  },
  methods: {
    add(step) {
      this.$emit('update:num', this.num + step)
    }
  }
}
</script>
<style></style>
